  import {
    token_expires
  } from '@/utils/Keyword'
  import {addressList} from "@/api/addressList"
  const addresslist = {
    state: {
      items: []
    },
    mutations: {
      ADDRESS_LIST: (state, data) => {
          state.items = data;
      }
    },
    actions: {
      ADDRESSLIST({
        commit,
        state
      }, info) {
        return new Promise((resolve, reject) => {
          addressList(info).then(res => {
            if (res != token_expires) {
              commit("ADDRESS_LIST", res);
              resolve(res)
            } else if(res == token_expires){
              resolve(token_expires)
            }else{
              resolve(false)
            }
          }).catch(err => {
            resolve(false)
          })
        })
      }
    }
  }
  export default addresslist

  